<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../../vue.js"></script>
</head>

<body>
    <div id="app">
        {{message}}
        <com-a>
            <!-- <p slot="myhead">我是头部内容</p> -->

            <!-- <template #myhead>
          <p>我是头部</p>
        </template> -->

            <!-- v-slot -->
            <!-- <template v-slot:[str]>
          <p>我是头部</p>
        </template> -->

            <!-- <template v-slot:myhead="obj">
          <p>我是头部内容，姓名是：{{obj.uname}} ，年龄：{{obj.age}}</p>
        </template> -->

            <p slot="myhead">我是头部</p>
            <p slot="mycount">我是中间内容</p>
            <p slot="myfoot">我是底部</p>
            <template v-slot:myadd="obj">
          <p>
              <p>我是内容</p>
              姓名是：{{obj.uname}} ，年龄：{{obj.age}}</p>
        </template>
        </com-a>
    </div>
    <template id="coma">
      <div>
        <h1>我是coma</h1>
        <slot name="myhead"></slot>
        <hr />
        <slot name="mycount"></slot>
        <hr />
        <slot name="myfoot"></slot>
        <hr />
        <slot name="myadd" uname="zzl" age="28"></slot>
        <!-- <slot name="myhead" uname="张三" age="20"></slot> -->
        <!-- <slot></slot> -->
        <!-- <slot name="myhead"></slot> -->
      </div>
    </template>
    <script>
        let comA = {
            template: "#coma",
        };

        new Vue({
            el: "#app",
            components: {
                comA,
            },
            data: {
                str: "myhead",
                message: "实例化",
            },
        });
    </script>
</body>

</html>